package top.mable;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.support.GenericApplicationContext;

/**
 * @author taffywen
 * @date 2022/4/16 9:43
 */
@SpringBootApplication
public class SpringEventApp {


    public static void main(String[] args) {

//        SpringApplication.run(SpringEventApp.class,args);

        GenericApplicationContext context = new GenericApplicationContext();
        context.addApplicationListener(event -> {
            System.out.println("接受到事件 " + event);
        });

        context.refresh();
        context.close();
    }
}
